package com.itheima.springbootwebtlias.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.springbootwebtlias.pojo.Emp;
import com.itheima.springbootwebtlias.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

//@Mapper
public interface EmpMapper extends BaseMapper<Emp> {

    /**
     * 统计员工职位人数
     */
    @MapKey("name")
    List<Map> jobCount();

    /**
     * 统计员工性别信息
     */
    @MapKey("key")
    List<Map> genderCount();

    // 登录
    @Select("select * from emp where username = #{username}")
    Emp selectByUsernameAndPassword(String username);
}
